//
//  DetailSonglist.m
//  __PRODUCTNAME__
//
//  Created by 曹曹 on 16/08/16
//  Copyright (c) __ORGANIZATIONNAME__. All rights reserved.
//

#import "DetailSonglist.h"
#import "DetailSingers.h"
#import "DetailUrllist.h"
#import "Auditionlist.h"
#import "DetailRightkey.h"

@implementation DetailSonglist

+ (NSDictionary *)objectClassInArray{
    return @{@"singers" : [DetailSingers class], @"urlList" : [DetailUrllist class], @"auditionList" : [Auditionlist class]};
}

- (void)setValue:(id)value forKey:(NSString *)key {
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"auditionList"]) {
        NSMutableArray *array = [NSMutableArray array];
        for (NSDictionary *dictioanry in value) {
            Auditionlist *list = [Auditionlist modelWithDictionary:dictioanry];
            [array addObject:list];
        }
        _auditionList = array;
    }
    if ([key isEqualToString:@"urlList"]) {
        NSMutableArray *array = [NSMutableArray array];
        for (NSDictionary *dictionary in value) {
            DetailUrllist *urllist = [DetailUrllist modelWithDictionary:dictionary];
            [array addObject:urllist];
        }
        _urlList = array;
    }
    if ([key isEqualToString:@"rightKey"]) {
        _rightKey = [DetailRightkey modelWithDictionary:value];
    }
    if ([key isEqualToString:@"singers"]) {
        NSMutableArray *array = [NSMutableArray array];
        for (NSDictionary *dictionary in value) {
            DetailSingers *singers = [DetailSingers modelWithDictionary:dictionary];
            [array addObject:singers];
        }
        _singers = array;
    }
}

@end
